﻿@model OrderControllerModel.Index
<div class="my-main">
    <div class="ui-box  ui-box-alpha">
        <div class="ui-box-head">
            <div class="ui-box-head-border">
                <div class="ui-box-head-title">
                    订单中心</div>
                <a href="#" class="ui-box-head-more">去购物</a>
            </div>
        </div>
        <div class="ui-box-container">
            <div class="ui-box-content">
                dd</div>
        </div>
        <div class="ui-box-container-noborder">
            <div class="ui-box-content">
            </div>
        </div>
        <div class="ui-box-container-noborder">
            <div class="tabbable">
                <ul class="nav nav-tabs" style="padding-left: 40px;">
                    <li class="active"><a href="#1">我的订单</a></li>
                    <li><a href="/order/auction">竞购订单</a></li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active">
                        <table class="ui-table ui-table-inbox ui-table-alpha">
                            <thead>
                                <tr>
                                    <th class="span4">
                                        商品信息
                                    </th>
                                    <th class="span1">
                                        单价(元)
                                    </th>
                                    <th class="span1">
                                        数 量
                                    </th>
                                    <th class="span2">
                                        订单金额(元)
                                    </th>
                                    <th class="span2">
                                        订单状态
                                    </th>
                                    <th class="span2">
                                        操 作
                                    </th>
                                </tr>
                            </thead>
                            @Model.Orders.Each(@<tbody class="@(item.Item.OrderStatus == OrderStatus.Pending ? "item-pending" : "item")">
                                <tr class="item-header">
                                    <td colspan="2">
                                        订单号：@(item.Item.Id)
                                    </td>
                                    <td colspan="2">
                                    </td>
                                    <td colspan="2">
                                        下单时间：@(item.Item.CreatedOn.ToString("yyyy-MM-dd HH:mm:ss"))
                                    </td>
                                </tr>
                                @for (var i = 0; i < item.Item.OrderItems.Count; i++)
                                {
                                    var temp = item.Item.OrderItems[i];
                                    <tr @(i < item.Item.OrderItems.Count - 1 ? "class=light" : string.Empty)>
                                        <td class="col  @(item.Item.OrderItems.Count > 1 ? "multiple light" : string.Empty)">
                                            <div class="media">
                                                <a class="pull-left" href="" target="_blank">
                                                    <img data-src="holder.js/64x64" class="media-object" alt="64x64" style="width: 64px;
                                                        height: 64px;" src="">
                                                </a>
                                                <div class="media-body">
                                                    <h5 class="media-heading">
                                                    @(temp.ProductName)
                                                    </h5>
                                                      @(temp.ProductAttribute)
                                                </div>
                                            </div>
                                        </td>
                                        <td class="col @(item.Item.OrderItems.Count > 1 ? "multiple light" : string.Empty)">
                                            @(temp.UnitPrice.ToString("N"))
                                        </td>
                                        <td class="col @(item.Item.OrderItems.Count > 1 ? "light" : string.Empty)">
                                            @(temp.Quantity)
                                        </td>
                                        @if (i == 0)
                                        {
                                            <td class="col" @(item.Item.OrderItems.Count > 1 ? "rowspan=" + (item.Item.OrderItems.Count) : string.Empty)>
                                                @(item.Item.SubTotal.ToString("N"))
                                            </td>
                                            <td class="col" @(item.Item.OrderItems.Count > 1 ? "rowspan=" + (item.Item.OrderItems.Count) : string.Empty)>
                                            </td>
                                            <td class="ui-table-action" @(item.Item.OrderItems.Count > 1 ? "rowspan=" + (item.Item.OrderItems.Count) : string.Empty)>
                                                @if (item.Item.OrderStatus == OrderStatus.Pending)
                                                {
                                                    <a href="/order/pay?param=@(item.Item.Id)" target="_blank">付款</a>
                                                }
                                            </td>
                                        }
                                    </tr>
                                }
                                <tr class="item-footer">
                                    <td colspan="6">
                                    </td>
                                </tr>
                            </tbody>)
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
